<?php class Universesinfo { 

    /***
     * DB Fields: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $id;

    /***
     * DB Fields: Name
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $Name;

    /***
     * DB Fields: GalaxyCount
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $GalaxyCount;

    /***
     * DB Fields: SystemCount
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $SystemCount;

    /***
     * DB Fields: PlanetCount
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $PlanetCount;

    /***
     * DB Fields: MaxUsers
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $MaxUsers;

    /***
     * DB Fields: UsersForDomination
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $UsersForDomination;

    /***
     * DB Fields: IsDomination
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $IsDomination;

    /***
     * DB Fields: IsDominationActive
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $IsDominationActive;

    /***
     * DB Fields: universeId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $universeId;

//--------------- GET METHODS ----------------------------- //
    /***
     * Get value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result id
     **/
    function get_id( ) {
        // returns the value of id
        return $this->id;
    }


    /***
     * Get value for field: Name
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result Name
     **/
    function get_Name( ) {
        // returns the value of Name
        return $this->Name;
    }


    /***
     * Get value for field: GalaxyCount
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result GalaxyCount
     **/
    function get_GalaxyCount( ) {
        // returns the value of GalaxyCount
        return $this->GalaxyCount;
    }


    /***
     * Get value for field: SystemCount
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result SystemCount
     **/
    function get_SystemCount( ) {
        // returns the value of SystemCount
        return $this->SystemCount;
    }


    /***
     * Get value for field: PlanetCount
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result PlanetCount
     **/
    function get_PlanetCount( ) {
        // returns the value of PlanetCount
        return $this->PlanetCount;
    }


    /***
     * Get value for field: MaxUsers
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result MaxUsers
     **/
    function get_MaxUsers( ) {
        // returns the value of MaxUsers
        return $this->MaxUsers;
    }


    /***
     * Get value for field: UsersForDomination
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result UsersForDomination
     **/
    function get_UsersForDomination( ) {
        // returns the value of UsersForDomination
        return $this->UsersForDomination;
    }


    /***
     * Get value for field: IsDomination
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result IsDomination
     **/
    function get_IsDomination( ) {
        // returns the value of IsDomination
        return $this->IsDomination;
    }


    /***
     * Get value for field: IsDominationActive
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result IsDominationActive
     **/
    function get_IsDominationActive( ) {
        // returns the value of IsDominationActive
        return $this->IsDominationActive;
    }


    /***
     * Get value for field: universeId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result universeId
     **/
    function get_universeId( ) {
        // returns the value of universeId
        return $this->universeId;
    }


//--------------- SET METHODS ----------------------------- //
    /***
     * Set value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function set_id( $id ) {
        // sets the value of id
        $this->id = $id;
    }

    /***
     * Set value for field: Name
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param Name
     * @result void
     **/
    function set_Name( $Name ) {
        // sets the value of Name
        $this->Name = $Name;
    }

    /***
     * Set value for field: GalaxyCount
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param GalaxyCount
     * @result void
     **/
    function set_GalaxyCount( $GalaxyCount ) {
        // sets the value of GalaxyCount
        $this->GalaxyCount = $GalaxyCount;
    }

    /***
     * Set value for field: SystemCount
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param SystemCount
     * @result void
     **/
    function set_SystemCount( $SystemCount ) {
        // sets the value of SystemCount
        $this->SystemCount = $SystemCount;
    }

    /***
     * Set value for field: PlanetCount
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param PlanetCount
     * @result void
     **/
    function set_PlanetCount( $PlanetCount ) {
        // sets the value of PlanetCount
        $this->PlanetCount = $PlanetCount;
    }

    /***
     * Set value for field: MaxUsers
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param MaxUsers
     * @result void
     **/
    function set_MaxUsers( $MaxUsers ) {
        // sets the value of MaxUsers
        $this->MaxUsers = $MaxUsers;
    }

    /***
     * Set value for field: UsersForDomination
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param UsersForDomination
     * @result void
     **/
    function set_UsersForDomination( $UsersForDomination ) {
        // sets the value of UsersForDomination
        $this->UsersForDomination = $UsersForDomination;
    }

    /***
     * Set value for field: IsDomination
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param IsDomination
     * @result void
     **/
    function set_IsDomination( $IsDomination ) {
        // sets the value of IsDomination
        $this->IsDomination = $IsDomination;
    }

    /***
     * Set value for field: IsDominationActive
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param IsDominationActive
     * @result void
     **/
    function set_IsDominationActive( $IsDominationActive ) {
        // sets the value of IsDominationActive
        $this->IsDominationActive = $IsDominationActive;
    }

    /***
     * Set value for field: universeId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param universeId
     * @result void
     **/
    function set_universeId( $universeId ) {
        // sets the value of universeId
        $this->universeId = $universeId;
    }

//--------------- CRUD METHODS ----------------------------- //
    /***
     * Create a new Record: universesinfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param Name
     * @param GalaxyCount
     * @param SystemCount
     * @param PlanetCount
     * @param MaxUsers
     * @param UsersForDomination
     * @param IsDomination
     * @param IsDominationActive
     * @param universeId
     * @result void
     **/
    function createnew_universesinfo( $id, $Name, $GalaxyCount, $SystemCount, $PlanetCount, $MaxUsers, $UsersForDomination, $IsDomination, $IsDominationActive, $universeId ) {

        // items to be inserted in the database 
        $_obj = array($id,
                      $Name,
                      $GalaxyCount,
                      $SystemCount,
                      $PlanetCount,
                      $MaxUsers,
                      $UsersForDomination,
                      $IsDomination,
                      $IsDominationActive,
                      $universeId); 

        // database object connection
        $dbConn = $GLOBALS['dbConn'];

        // perform insert in the database
        $dbConn->insert("universesinfo", $_obj);
    }

    /***
     * Retrived an existing record: universesinfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result new Universesinfo
     **/
    function get_universesinfo( $id ) {

        // retrive the data
        $dbConn = $GLOBALS['dbConn'];

        // retrieved value in the database
        $_resultSet = $dbConn->doQuery("SELECT * FROM universesinfo WHERE id = '$id'");

        $__universesinfoObj = new universesinfo();
        // return the retrived from the database

        // create a new object
        $__obj = new Universesinfo();
        $__obj->set_id($_resultSet[0]['id']);
        $__obj->set_Name($_resultSet[0]['Name']);
        $__obj->set_GalaxyCount($_resultSet[0]['GalaxyCount']);
        $__obj->set_SystemCount($_resultSet[0]['SystemCount']);
        $__obj->set_PlanetCount($_resultSet[0]['PlanetCount']);
        $__obj->set_MaxUsers($_resultSet[0]['MaxUsers']);
        $__obj->set_UsersForDomination($_resultSet[0]['UsersForDomination']);
        $__obj->set_IsDomination($_resultSet[0]['IsDomination']);
        $__obj->set_IsDominationActive($_resultSet[0]['IsDominationActive']);
        $__obj->set_universeId($_resultSet[0]['universeId']);


        return $__obj;
    }

    /***
     * Update an existing record: universesinfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param itemsToBeUpdated = array()
     * @result void
     **/
    function update_universesinfo( $id, $itemsToBeUpdated = array() ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs update in the database
         foreach($itemsToBeUpdated as $_fName => $_fVal) { 
               $dbConn->addValuePair($_fName, $_fVal);
         }

         // perform update operation
         $dbConn->update("universesinfo", "id = '$id'");
    }

    /***
     * Delete an existing record: universesinfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function delete_universesinfo( $id ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs deletion of data
         $dbConn->delete("universesinfo", "id = '$id'");
    }

    /***
     * Retrived list of objects base on a given parameters: universesinfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param conditionalStatement = ''
     * @result collection of objects: Universesinfo
     **/
    function list_universesinfo( $conditionalStatement = '' ) {

         $dbConn = $GLOBALS['dbConn'];
         // check if there is a given parameter list
         if(!empty($conditionalStatement)) { 
              $sqlStatement = "SELECT * FROM universesinfo WHERE $conditionalStatement"; 
         } else { 
              $sqlStatement = "SELECT * FROM universesinfo";
         }

         // retrieve the values base on the query result
         $__resObj = $dbConn->doQuery($sqlStatement);

         $__collectionOfObjects = array();
         foreach($__resObj as $__rs) { 
            $__newObj = new Universesinfo();

            $__newObj->set_id($__rs['id']);
            $__newObj->set_Name($__rs['Name']);
            $__newObj->set_GalaxyCount($__rs['GalaxyCount']);
            $__newObj->set_SystemCount($__rs['SystemCount']);
            $__newObj->set_PlanetCount($__rs['PlanetCount']);
            $__newObj->set_MaxUsers($__rs['MaxUsers']);
            $__newObj->set_UsersForDomination($__rs['UsersForDomination']);
            $__newObj->set_IsDomination($__rs['IsDomination']);
            $__newObj->set_IsDominationActive($__rs['IsDominationActive']);
            $__newObj->set_universeId($__rs['universeId']);

            // add object to collection 
            array_push($__collectionOfObjects, $__newObj);
         }

         // return collection of objects
         return $__collectionOfObjects;
    }

} ?>